package com.guocheng.modules.login.model.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.guocheng.base.BaseModel;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 菜单实体类
 */
@Data
@Accessors(chain = true)
@TableName("sys_menu")
public class Menu {
    //主键
    @TableId(type = IdType.AUTO)
    private Integer id;
    //菜单名称
    private String title;
    //父级菜单名称
    @TableField(exist = false)
    private String parentName;      //前端修改回显需要
    //父级菜单
    private Integer parentId;
    //菜单url
    private String href;
    //菜单类型
    private Integer type;
    //排序
    private Integer sort;
    //菜单备注
    private String description;
    //菜单标识
    private String authority;
    //创建时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createDate;
    @TableField(exist = false)
    private List<Menu> child;
}
